import App from './App';
import React from 'react';
import { createRoot } from 'react-dom/client';
import 'antd/dist/antd.less';
import '../public/widget/widget-main.css';

import AgentServer from '../public/widget';
import './utils/i18n';

console.log('process.env.NODE_ENV', process.env.NODE_ENV, process.env.TARGET_ENV);

AgentServer.Agent.init(loginUrl, {
	isCallProgress: true,
	isImagePreview: true,
	userInfoVisible: false,
	managementMenuConfigVisible: false,
	watermarkConfigVisible: false,
	languageConfigVisible: false,
	acceptCallConfigVisible: true,
	chatBoxVisible: true,
	layoutConfigVisible: true,
	bizPannelVisible: true,
	isNotifyCustomerMediaUpgrade: true
});
const { configure } = AgentServer.Agent;
configure.setCountlyParam({ appkey: '', host: '' });
configure.setServiceUrl(loginUrl);
configure.setPreferenceSettings({ ...configure.preferenceSettings, ignoreUserSettingsMenu: [1, 3], ignoreTools: [3, 4, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27] });

configure.setBackgroundImageList(backgroundImageList);
configure.setWatermarkImageList(watermarkImageList);
configure.setTransferScene(false);
configure.setDefaultMediaOptions(defaultMediaOptions);
console.log(configure);

const container = document.getElementById('mindray-root');

const root = createRoot(container!); // createRoot(container!) if you use TypeScript
root.render(<App />);
